﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using BusinessLogic;
using BusinessEntity;
using System.Data;

namespace Clientes
{
    /// <summary>
    /// Summary description for ClienteService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class ClienteService : System.Web.Services.WebService
    {

        [WebMethod]
        public string RegistrarCliente(string dni, string nombres, string direccion, string telefono)
        {
            ClienteBE cliente = new ClienteBE();
            cliente.dni = dni;
            cliente.nombre_apellido = nombres;
            cliente.direccion = direccion;
            cliente.telefono = telefono;

            ClienteBL clienteBL = new ClienteBL();
            clienteBL.RegistrarCliente(cliente);

            return "Cliente Registrado";
        }
        [WebMethod]
        public DataSet ListarCliente(string nombres)
        {
            ClienteBL clienteBL = new ClienteBL();

            return clienteBL.Listar(nombres);
        }
    }
}
